package other.a锁重入特性;

/**
 * Created by Administrator on 2016/12/3.
 */
public class ChildObject extends SupObject {

    public synchronized void childMethod() {
        System.out.println("线程"+Thread.currentThread().getName()+" 开始执行ChildObject对象的方法");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("线程"+Thread.currentThread().getName()+" 结束执行ChildObject对象的方法");

        System.out.println("线程"+Thread.currentThread().getName()+" 开始执行SupObject对象的方法");
        this.supMethod();
        System.out.println("线程"+Thread.currentThread().getName()+" 结束执行SupObject对象的方法");

    }
}
